package org.dy.db.model.crud;

import java.util.List;

import org.dy.db.Page;
import org.dy.db.model.FieldInfo;
import org.dy.db.model.Row;

public interface Crudable {
	
	List<Row> listAll() throws CrudOptException;
	
	List<Row> listByQuery(Row row) throws CrudOptException;
	
	Page listInPage() throws CrudOptException;
	
	Page listPageByQuery(Row row, int cp, int npp) throws CrudOptException;
	
	Row getOne(FieldInfo fi) throws CrudOptException;
	
	Row getOne(Row row) throws CrudOptException;

	Row getNext(FieldInfo fi) throws CrudOptException;
	
	boolean create(Row row) throws CrudOptException;
	
	boolean createBatch(Row[] rows) throws CrudOptException;
	
	boolean update(Row row) throws CrudOptException;
	
	boolean updateBatch(Row[] rows) throws CrudOptException;
	
	boolean delete(FieldInfo fi) throws CrudOptException;
	
	boolean delete(Row row) throws CrudOptException;
}
